package com.example.sina.base;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;

import org.apache.http.conn.ConnectTimeoutException;
import org.json.JSONException;
import org.json.JSONObject;

import com.example.sina.utils.Utils;
import com.tencent.open.HttpStatusException;
import com.tencent.open.NetworkUnavailableException;
import com.tencent.tauth.IRequestListener;

public class BaseIRequestListener implements IRequestListener {

	private String mScope = "all";
	private Boolean mNeedReAuth = false;

	public BaseIRequestListener(String scope, boolean needReAuth) {
		mScope = scope;
		mNeedReAuth = needReAuth;
	}

	@Override
	public void onComplete(JSONObject result, Object obj) {
		Utils.logError("onComplete", result.toString() + "---" + obj.toString());
	}

	@Override
	public void onConnectTimeoutException(ConnectTimeoutException arg0, Object arg1) {
		arg0.printStackTrace();
	}

	@Override
	public void onHttpStatusException(HttpStatusException arg0, Object arg1) {
		arg0.printStackTrace();
	}

	@Override
	public void onIOException(IOException arg0, Object arg1) {
		arg0.printStackTrace();
	}

	@Override
	public void onJSONException(JSONException arg0, Object arg1) {
		arg0.printStackTrace();
	}

	@Override
	public void onMalformedURLException(MalformedURLException arg0, Object arg1) {
		arg0.printStackTrace();
	}

	@Override
	public void onNetworkUnavailableException(NetworkUnavailableException arg0, Object arg1) {
		arg0.printStackTrace();
	}

	@Override
	public void onSocketTimeoutException(SocketTimeoutException arg0, Object arg1) {
		arg0.printStackTrace();
	}

	@Override
	public void onUnknowException(Exception arg0, Object arg1) {
		arg0.printStackTrace();
	}

}
